package org.Vancl.Dao.ImpI;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.Vancl.Dao.tuijianDao;
import org.Vancl.Dao.youxuantuijianDao;
import org.Vancl.entity.youxuantuijian;
import org.Vancl.utils.BaseDao;



public class youxuantuijianDaoImpI extends BaseDao implements youxuantuijianDao {

	
	public List<youxuantuijian> getid(int id){
		String sql="SELECT * FROM youxuantuijian where yypeid =?";
		ResultSet rs=super.executeQuery(sql,id);
		List<youxuantuijian> list=new ArrayList();
		try {
			while(rs.next()) {
				youxuantuijian youxuantuijian=new youxuantuijian();
				youxuantuijian.setYid(rs.getInt("yid"));
				youxuantuijian.setYid(rs.getInt("yypeid"));
				youxuantuijian.setYimages(rs.getString("yimages"));
				youxuantuijian.setYname(rs.getString("yname"));
				youxuantuijian.setYprice(rs.getString("yprice"));
				list.add(youxuantuijian);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally {
			try {
				super.CloseAll(rs, rs.getStatement().getConnection(), rs.getStatement());
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return list;
	}
}
